import request from '@/utils/request'

// 查询商品分类列表
export function listCate(query) {
  return request({
    url: '/api/cate/list',
    method: 'get',
    params: query
  })
}

// 查询商品分类字典
export function dictList() {
  return request({
    url: '/api/cate/dictList',
    method: 'get'
  })
}

// 查询商品分类详细
export function getCate(id) {
  return request({
    url: '/api/cate/' + id,
    method: 'get'
  })
}

// 新增商品分类
export function addCate(data) {
  return request({
    url: '/api/cate',
    method: 'post',
    data: data
  })
}

// 修改商品分类
export function updateCate(data) {
  return request({
    url: '/api/cate',
    method: 'put',
    data: data
  })
}

// 删除商品分类
export function delCate(id) {
  return request({
    url: '/api/cate/' + id,
    method: 'delete'
  })
}



export function getOrderList(data) {
  return request({
    url: `/api/order/saleSearch`,
    method: "post",
    data:data
  });
}


export function cancel(data) {
  return request({
    url: `/api/order/cancel?orderId=${data.id}`,
    method: "get",
  });
}

export function saleCount(data) {
  return request({
    url: `/api/order/saleCount`,
    method: "get",
  });
}

